
#ifndef _NODE_H_
#define _NODE_H_


#include "config.h"
#include <map>
#include <string>

namespace KEngine
{

	class _KExport Node
	{
	public:
		typedef std::map<std::string, Node*> ChildNodeMap;
		typedef ChildNodeMap::iterator ChildNodeIterator;
		typedef ChildNodeMap::const_iterator ChildNodeConstIterator;
		typedef ChildNodeMap::value_type ChildNodeValue;

	public:
		Node();
		Node(const std::string& name);
		virtual ~Node();

		const std::string& getName() const;
		void setName(const std::string& name);
		const Node* getParent() const;
		void setParent(Node* parent);

		void addChild(Node* child);
		unsigned int numChildren() const;
		Node* getChild(unsigned int index) const;
		Node* getChild(std::string& name) const;
		Node* removeChild(unsigned int index);
		Node* removeChild(Node* child);
		Node* removeChild(std::string& name);
		void removeAllChildren();
		void destroy();

	protected:
		Node* _parent;
		ChildNodeMap _children;
		std::string _name;
	};
	
};

#endif

